﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PaltForm.aspx.cs" Inherits="IT9D.WebApp.PaltForm" %>
<%@ Register Assembly="9D.Controls" Namespace="IT9D.Controls" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>	Max </title>

	<link rel="stylesheet" type="text/css" href="JavaScript/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="JavaScript/themes/icon.css">
	<script type="text/javascript" src="JavaScript/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="JavaScript/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="JavaScript/jquery.form.js"></script>
	<script type="text/javascript">

	            function addTab(title, href) {
	                var tt = $('#main-center');
	                if (tt.tabs('exists', title)) {
	                    tt.tabs('select', title);
	                } else {
	                    if (href) {
	                        var content = '<iframe scrolling="no" frameborder="0"  src="' + href + '" style="width:100%;height:100%;"></iframe>';
	                    } else {
	                        var content = '正在測試';
	                    }
	                    tt.tabs('add', {
	                        title: title,
	                        closable: true,
	                        content: content
	                    });
	                }
	            }

	            function addTabs(title, href) {
	                var tt = $('#main-center');
	                if (tt.tabs('exists', title)) {
	                    //tt.tabs('select', title);
	                } else {
	                    if (href) {
	                        var content = '<iframe scrolling="no" frameborder="0" id="myframe" src="' + href + '" style="width:100%;height:100%;"></iframe>';
	                    } else {
	                        var content = '正在測試';
	                    }
	                    tt.tabs('add', {
	                        title: title,
	                        closable: false,
	                        content: content
	                    });
	                }
	            }
	            
	           var timer = setTimeout(InitUser, 500);
	           function InitUser() {
	               $.get("../AjaxData/GetUserInfo.aspx?n=" + Math.random(), function(data, textStatus) {
	                   var user;

	                   user = eval('(' + data + ')');
	                   //alert(data);
	                   //alert(user.LoginName);
	                   if (user.iSun__GradeId == 3 || user.iSun__GradeId == 4) {
	                       addTabs("待辦事宜", "HtmlWindows/E_Newtopic5.html");

	                       return;
	                   }
	                   if (user.iSun__GradeId == 5) {
	                       addTabs("待辦事宜", "HtmlWindows/E_Newtopic.html");
	                       return;
	                   }

	                   if (user.iSun__GradeId == 1 || user.iSun__GradeId == 2) {
	                       addTabs("待辦事宜", "HtmlWindows/E_Newtopic2.html");
	                       return;
	                   }
	                   if (user.iSun__GradeId == 6) {
	                       addTabs("待辦事宜", "");
	                       return;
	                   }

	                   if (user.LoginName == undefined && user.iSun_GradeId == undefined) {
	                       $.messager.alert('提示', '你的相关信息己经被注销，需要重新验证!', 'info');
	                       setTimeout('rl()', 1000);
	                   }
	                   //alert(user.iSun_GradeId);
	               });
	           }
               
	           function cancel() {
	               window.location = "Default.aspx";
	           }
	           
      	       function cp()
	           {
	               var password1 = $('#NewPassword0').val();
	               var password2 = $('#NewPassword1').val();
	               if (password1 == '') {
	                   $.messager.alert('提示', '请输入密碼!', 'info');
	               }
	                if(password1==password2)
	                {
	                    ChangePassword(password1);
	                }
	                else
	                {
	                     $.messager.alert('提示', '二個密碼不一致!', 'info');
	                }
	            }

	            function rl() {
	                window.location = "default.aspx";
	            }
	            
	            function viewdoc(url) {
	                $('#myframe')[0].src = url;
	                open('Div1');
	            }


	            
	</script>
   
</head>
<body class="easyui-layout">
    
	<%--<div id="mymenu" style="width:150px;">
		<div>item1</div>
		<div>item2</div>
	</div>
	 title="歡迎進入萬里機構選題管理系統平台"
	--%>
<div region="north"  style="height:100px;padding:5px;" >
        
                <img alt="" src="HtmlWindows/" style="width: 70px; height: 78px; float:left;"  />  
                <div style="float:right; text-align:right"> <H1 >Max Content Manage System</H1>
                <cc1:UserInfo runat="server" ></cc1:UserInfo>     <span>[<a   href="javascript:void(0)" onclick="open1();">修改密碼</a>]</span> <span>[<a href="logout.aspx">退出系統</a>]</span>
                </div> 
		</div>
	
		<div region="east" icon="icon-reload" title="Tree Menu" split="true" style="width:130px;">
			<ul class="easyui-tree" url="tree_data.json"></ul>
		</div>
		<div region="west" split="true" title="功能菜單" style="width:200px;padding1:1px;overflow:hidden;">
			<div class="easyui-accordion" fit="true" border="false">
               <!-- 菜单 -->
                <cc1:DropMenu ID="DropMenu1" runat="server"></cc1:DropMenu>	
                <div></div>
			   <!-- 菜单 -->
			</div>
		</div>
		<div region="center" title="數據窗口" style="overflow:hidden;" >
			<div class="easyui-tabs" fit="true" border="false" id="main-center">
			</div>
		</div>
	
	
<div id="w" class="easyui-window" title="My Window" icon="icon-save" style="width:500px;height:200px;padding:5px;background: #fafafa;" closed="true">
		<div class="easyui-layout" fit="true">
			<div region="center" border="false" style="padding:10px;background:#fff;border:1px solid #ccc;">
                <table>
                    <tbody>
                        <tr>
                            <td>新密碼:</td>
                            <td><input type="password" id="NewPassword0"/></td>
                        </tr>
                        <tr>
                            <td>確認密碼:</td>
                            <td><input type="password" id="NewPassword1"/></td>
                        </tr>
                    </tbody>
                </table>

			</div>
			<div region="south" border="false" style="text-align:right;height:30px;line-height:30px;">
				<a class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" onclick="cp();">確認</a>
			</div>
		</div>
</div>

<div id="Div1" class="easyui-window" title="My Window" icon="icon-save" style="width:1000px;height:600px;padding:5px;background: #fafafa;" closed="true">
		<div class="easyui-layout" fit="true">
			<div id="docview" region="center" border="false" style="padding:10px;background:#fff;border:1px solid #ccc;">
                <iframe id="myframe" scrolling="no" frameborder="0"  src="" style="width:100%;height:100%;"></iframe>
			</div>
			<div region="south" border="false" style="text-align:right;height:30px;line-height:30px;">
				<a class="easyui-linkbutton" icon="icon-ok" href="javascript:void(0)" onclick="close('Div1');">關閉</a>
			</div>
		</div>
	</div>	
<div id="datacache"></div>		
</body>
</html>  